package userend

import (
	"gitee.com/baal1990/epidemic/api/v1"
	"gitee.com/baal1990/epidemic/middleware"
	"github.com/gin-gonic/gin"
)

// UserRouter 用户侧接口
func UserRouter(r *gin.Engine) {
	var epidemicUserApi = v1.ApiGroupApp.EpidemicApiGroup.EpidemicUserApi
	var epidemicInvestigationFormApi = v1.ApiGroupApp.EpidemicApiGroup.EpidemicInvestigationFormApi
	var epidemicRelatedStaffApi = v1.ApiGroupApp.EpidemicApiGroup.EpidemicRelatedStaffApi
	mobile := r.Group("epidemic_mobile")
	mobile.Use(middleware.Auth())
	{
		mobile.GET("/user/find", epidemicUserApi.FindEpidemicUser)                                                      // 手机号获取用户信息
		mobile.POST("/user/edit", epidemicUserApi.CreateOrUpdateEpidemicUserMobile)                                     // 新建/编辑
		mobile.GET("/related_staff/find", epidemicRelatedStaffApi.GetEpidemicRelatedStaffInfoUserSide)                  // 涉疫登记信息查询
		mobile.POST("/related_staff/edit", epidemicRelatedStaffApi.EpidemicRelatedStaffCheckinUserSide)                 // 涉疫登记
		mobile.POST("/related_staff/temperature", epidemicRelatedStaffApi.HealthCheckinUserSide)                        // 健康登记
		mobile.GET("/investigation/list", epidemicInvestigationFormApi.GetEpidemicInvestigationFormListUserSide)        // 用户侧-排查表列表
		mobile.POST("/investigation/checkin", epidemicInvestigationFormApi.GetEpidemicInvestigationFormCheckinUserSide) // 用户侧-排查表填报
	}
}
